package org.springsource.domain;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springsource.services.AccountService;

public class AccountConverter implements Converter<Long, Account> {

	private AccountService accountManager;

	@Autowired
	public AccountConverter(AccountService accountManager) {
		this.accountManager = accountManager;
	}

	public Account convert(Long source) {
		return this.accountManager.getAccount(source);
	}

}
